﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Npgsql;

using BarFaculdade.Module;
using BarFaculdade.Controller;

namespace BarFaculdade
{
   public partial class frmPrincipal : Form
   {
       Usuario usuario = null;
      public frmPrincipal()
      {
         InitializeComponent();
         usuario = new Usuario();
      }
      public frmPrincipal(Usuario usuario)
      {
          this.usuario = usuario;
      }

      private void configuaçõesToolStripMenuItem_Click(object sender, EventArgs e)
      {
          
      }

      private void usuariosToolStripMenuItem_Click(object sender, EventArgs e)
      {
          frmCadClientes cadCli = new frmCadClientes();

          cadCli.MdiParent = this;

          cadCli.Show();
      }

      private void loggoutToolStripMenuItem_Click(object sender, EventArgs e)
      {
          UsuarioController userControl = new UsuarioController();

          if (userControl.desconectar())
          {
              Application.Exit();
          }
      }

      private void produtosToolStripMenuItem_Click(object sender, EventArgs e)
      {
          frmPesqCli pcli = new frmPesqCli();

          pcli.MdiParent = this;

          pcli.Show();
      }
       
   }
}
